package cn.yj.alipay.config;

import cn.yj.common.config.IPayConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author 永健
 * @since 2022-02-17 19:52
 */
@ConfigurationProperties(prefix = "pay.alipay")
public class AliPayConfig implements IPayConfig {
    public final static String CERT = "cert";
    public final static String PUBLIC_KEY = "publicKey";
    private String signModel=CERT;
    private String url;
    private String appId;
    private String charset;
    private String appPrivateKey;
    private String format;
    private String alipayPublicKey;
    private String signType;

    private String notifyUrl;
    private String returnUrl;

    private String appCertPath;

    private String alipayCertPath;

    private String alipayRootCertPath;

    public boolean isCert(){
        return CERT.equals(signModel);
    }

    public String getUrl() {
        return url;
    }

    public AliPayConfig setUrl(String url) {
        this.url = url;
        return this;
    }

    public String getAppId() {
        return appId;
    }

    public AliPayConfig setAppId(String appId) {
        this.appId = appId;
        return this;
    }

    public String getReturnUrl() {
        return returnUrl;
    }

    public AliPayConfig setReturnUrl(String returnUrl) {
        this.returnUrl = returnUrl;
        return this;
    }

    public String getAppPrivateKey() {
        return appPrivateKey;
    }

    public AliPayConfig setAppPrivateKey(String appPrivateKey) {
        this.appPrivateKey = appPrivateKey;
        return this;
    }

    public String getFormat() {
        return format;
    }

    public AliPayConfig setFormat(String format) {
        this.format = format;
        return this;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public AliPayConfig setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
        return this;
    }

    public String getAlipayPublicKey() {
        return alipayPublicKey;
    }

    public AliPayConfig setAlipayPublicKey(String alipayPublicKey) {
        this.alipayPublicKey = alipayPublicKey;
        return this;
    }

    public String getSignType() {
        return signType;
    }

    public AliPayConfig setSignType(String signType) {
        this.signType = signType;
        return this;
    }

    public String getAppCertPath() {
        return appCertPath;
    }

    public AliPayConfig setAppCertPath(String appCertPath) {
        this.appCertPath = appCertPath;
        return this;
    }

    public String getAlipayCertPath() {
        return alipayCertPath;
    }

    public AliPayConfig setAlipayCertPath(String alipayCertPath) {
        this.alipayCertPath = alipayCertPath;
        return this;
    }

    public String getAlipayRootCertPath() {
        return alipayRootCertPath;
    }

    public AliPayConfig setAlipayRootCertPath(String alipayRootCertPath) {
        this.alipayRootCertPath = alipayRootCertPath;
        return this;
    }

    public String getCharset() {
        return charset;
    }

    public AliPayConfig setCharset(String charset) {
        this.charset = charset;
        return this;
    }

    public String getSignModel() {
        return signModel;
    }

    public AliPayConfig setSignModel(String signModel) {
        this.signModel = signModel;
        return this;
    }
}
